#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#define N 100000
using namespace std;
int n,m[2],ans,f[2][N+5],id[N+5];
pair<int,int> a[2][N+5];
vector<int> pre[2][N+5];
int main()
{
	freopen("airport.in","r",stdin);
	freopen("airport.out","w",stdout);
	scanf("%d %d %d",&n,&m[0],&m[1]);
	for(int o=0;o<2;++o)
	{
		for(int i=1;i<=m[o];++i) scanf("%d %d",&a[o][i].first,&a[o][i].second);
		sort(a[o]+1,a[o]+1+m[o]);
		for(int i=1;i<=m[o];++i) pre[o][lower_bound(a[o]+1,a[o]+1+m[o],make_pair(a[o][i].second,0))-a[o]].push_back(i);
		int cnt=0;priority_queue<int,vector<int>,greater<int> > q;
		for(int i=1;i<=m[o];++i)
		{
			for(int j:pre[o][i]) q.push(id[j]);
			if(q.empty()) id[i]=++cnt;
			else id[i]=q.top(),q.pop();
			++f[o][id[i]];
		}
		for(int i=1;i<=n;++i) f[o][i]+=f[o][i-1];
	}
	for(int i=0;i<=n;++i) ans=max(ans,f[0][i]+f[1][n-i]);
	printf("%d",ans);
	return 0;
}
